﻿#pragma once

#include "MaterialGraph/Node/MaterialGraphNodeModel.h"
#include "VectorOperation.h"
#include "MaterialVectorOperationNodeModel.m.h"



//拥有最多三个向量输入
//和一个浮点输入
//和一个向量/浮点输出
RCLASS(ExtraHeader="MaterialGraph/Pin/MaterialGraphPinModel.h")
class RMaterialVectorOperationNodeModel : public RMaterialGraphNodeModel
{
    ROBJECT

public:
    virtual void FirstTimeInitializeObject() override;

    virtual CString GenerateExpression() override;

    EMaterialVectorOperationType GetOperationType() const
    {
        return OperationType;
    }

    void SetOperationType(EMaterialVectorOperationType InOperationType)
    {
        OperationType = InOperationType;
        UpdatePinVisibility();
        OnOperationTypeChanged.ExecuteIfBound();
    }

    TDelegate<void> OnOperationTypeChanged;

protected:
    RFIELD()
    EMaterialVectorOperationType OperationType;

    void UpdatePinVisibility();
};